using JMCOM.Components.EpsonRobot;
using JMCOM.Components.EpsonRobot.NodeFlow;

namespace JMCOM
{
    public class JMCOM : IModule
    {
        private readonly IRegionManager _regionManager;
        private readonly IContainerProvider _container;

        public JMCOM(IRegionManager regionManager, IContainerProvider container)
        {
            _regionManager = regionManager;
            _container = container;
        }

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {
            // 注册 View 与 ViewModel 做导航用
            containerRegistry.RegisterForNavigation< NodesEditor, 
                NodeEditorViewModel>("NodesEditorView");
            containerRegistry.RegisterForNavigation< RobotView, 
                RobotViewModel>("EpsonRobotView");
         
        }

        public void OnInitialized(IContainerProvider containerProvider)
        {
            // 模块加载后，不强制立即注入 View（交由主程序导航）。
            // 可选择自动注入到 Region：
            // _regionManager.RequestNavigate("MainRegion", "EpsonRobotView");
             
        }
    }
}